<?php

namespace app\admin\model\flow;

use think\Model;

class Track extends Model
{
    // 表名
    protected $name = 'flow_track';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    
    // 追加属性
    protected $append = [
        'examineStatus_text'
    ];

    public function getExaminestatusList()
    {
        return ['1' => __('Examinestatus 1'),'0' => __('Examinestatus 0'),'2' => __('Examinestatus 2')];
    }     

    public function getExaminestatusTextAttr($value, $data)
    {        
        $value = $value ? $value : (isset($data['examineStatus']) ? $data['examineStatus'] : '');
        $list = $this->getExaminestatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }
}
